#/bin/sh
app_path=`pwd`
mkdir -p externl/src
cd ${app_path}/externl/src

git clone https://github.com/redis/hiredis.git
git clone https://github.com/msgpack/msgpack-c.git

externl_dir=${app_path}/externl
hiredis_dir=${externl_dir}/src/hiredis
msgpackc_dir=${externl_dir}/src/msgpack-c

cd ${hiredis_dir}
make PREFIX=${externl_dir} install

cd ${msgpackc_dir}
cmake -DCMAKE_INSTALL_PREFIX=${externl_dir}
make PREFIX=${externl_dir} install
